#include <stdio.h>

int main(int argc, char *argv[])
{

    int n, m;
    int i = 0, k = 0, z = 0;
    scanf("%d %d", &n, &m);
    int scores[n][m];
    for (i = 0; i < n; i++)
    {
        for (k = 0; k < m; k++)
        {
            scanf("%d", &scores[i][k]);
        }
    }
    
    for (i = 0; i < n; i++)
    {
        for (k = 0; k < m; k++)
        {
            if (scores[i][k] < 60)
            {
                printf("%d:", i+1);
                for (z = 0; z < m; z++)
                {
                    printf("%d ", scores[i][z]);
                }
                printf("\n");
                break;
            }
        }
    }

    return 0;
}